package groovy.sample.userguide.singleton.example3

class Calculator2Impl implements Calculator2 {

	@Override
	def add(a, b) {
		total++
		a + b
	}

	private total = 0
	
	def getTotalCalculations() {
		'Total Calculations: ' + total
	}
	
	String toString() { 'Calc: ' + hashCode()}
}
